package com.gasolinator.a.app.helper;

import com.gasolinator.a.app.GasolinatorData;
import com.gasolinator.a.app.GasolinatorStation;

import java.util.Comparator;

public class GasolinatorStationComparator implements Comparator<GasolinatorStation>
{
  String combustible;
  int type;

  public GasolinatorStationComparator(int type, String combustible)
  {
    this.type = type;
    this.combustible = combustible;
  }

  public int compare(GasolinatorStation paramGasStation1, GasolinatorStation paramGasStation2)
  {
    int i;
    if (type == GasolinatorData.FAVORITES)
    {
      boolean bool1 = paramGasStation2.getFavorite();
      Boolean localBoolean1 = new Boolean(bool1);
      Boolean localBoolean2 = Boolean.valueOf(paramGasStation1.getFavorite());
      if (localBoolean1.compareTo(localBoolean2) == 0)
      {
        String str1 = this.combustible;
        double d1 = paramGasStation1.getPrice(str1);
        Double localDouble1 = new Double(d1);
        String str2 = this.combustible;
        Double localDouble2 = Double.valueOf(paramGasStation2.getPrice(str2));
        i = localDouble1.compareTo(localDouble2);
      }
    }
    while (true)
    {
      //return i;
      boolean bool2 = paramGasStation2.getFavorite();
      Boolean localBoolean3 = new Boolean(bool2);
      Boolean localBoolean4 = Boolean.valueOf(paramGasStation1.getFavorite());
      i = localBoolean3.compareTo(localBoolean4);
      //continue;
      if (type == GasolinatorData.PRICE)
      {
        String str3 = this.combustible;
        double d2 = paramGasStation1.getPrice(str3);
        Double localDouble3 = new Double(d2);
        String str4 = this.combustible;
        Double localDouble4 = Double.valueOf(paramGasStation2.getPrice(str4));
        if (localDouble3.compareTo(localDouble4) == 0)
        {
          double d3 = paramGasStation1.getDistance().doubleValue();
          Double localDouble5 = new Double(d3);
          Double localDouble6 = paramGasStation2.getDistance();
          i = localDouble5.compareTo(localDouble6);
          continue;
        }
        String str5 = this.combustible;
        double d4 = paramGasStation1.getPrice(str5);
        Double localDouble7 = new Double(d4);
        String str6 = this.combustible;
        Double localDouble8 = Double.valueOf(paramGasStation2.getPrice(str6));
        i = localDouble7.compareTo(localDouble8);
        continue;
      }
      double d5 = paramGasStation1.getDistance().doubleValue();
      Double localDouble9 = new Double(d5);
      Double localDouble10 = paramGasStation2.getDistance();
      i = localDouble9.compareTo(localDouble10);
      return i;
    }

  }
}

/* Location:           /home/fjhidalgo/Escritorio/gasolinator_flips/classes.dex.dex2jar.jar
 * Qualified Name:     com.gasolinator.a.app.GasStationComparator
 * JD-Core Version:    0.6.0
 */